<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录成功</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }

        .success-container {
            text-align: center;
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 300px;
        }

        .welcome-message {
            font-size: 24px;
            color: #333;
            margin-bottom: 20px;
        }

        .user-info {
            font-size: 16px;
            color: #555;
            margin-bottom: 20px;
        }

        .action-buttons {
            display: flex;
            justify-content: space-around;
        }

        .action-button {
            padding: 10px 20px;
            border: none;
            background-color: #007bff;
            color: white;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .action-button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="success-container">
        <div class="welcome-message">欢迎回来！</div>
        登录人: <span id="loginUser"></span>

        <div class="action-buttons">
            <button class="action-button" onclick="redirectToDashboard()">进入主页</button>
            <button class="action-button" onclick="logout()">退出登录</button>
        </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!--    <script>-->
<!--        function redirectToDashboard() {-->
<!--            alert('跳转到主页');-->
<!--            // 可以在这里添加跳转逻辑，例如 window.location.href = 'dashboard.html';-->
<!--        }-->

<!--        function logout() {-->
<!--            alert('退出登录');-->
<!--            // 可以在这里添加退出登录逻辑，例如清除session或token等。-->
<!--        }-->
<!--    </script>-->

    <script>
        $.ajax({
            url: '/user/getUserInfo',
            type: 'get',
            success: function (data) {
                $("#loginUser").text(data);
            },
            error: function (data) {
                alert(data);
            }
        });
    </script>
</body>
</html>
